﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Skyhook.Core
{
    public static class WorldCamera
    {
        static Camera Camera = null;

        public static void Initialize(int width, int height, int viewwidth, int viewheight, float tilewidth = 64.0f, float tileheight = 32.0f)
        {
            Camera = new Camera(new Rectangle((int)(-tilewidth / 2.0f * height - viewwidth / 2), 0 - viewheight / 2, (int)(tilewidth / 2.0f * height + tilewidth / 2.0f * width + viewwidth), (int)(tileheight / 2.0f * height + tileheight / 2.0f * width + viewheight)), viewwidth, viewheight);
            Camera.Put(viewwidth / 2, viewheight / 2);
        }

        public static void Move(int dx, int dy)
        {
            Camera.Move(dx, dy);
        }

        public static void Put(int x, int y)
        {
            Camera.Put(x, y);
        }

        public static void AddListener(ICameraListener listener)
        {
            Camera.AddListener(listener);
        }

        public static void RemoveListener(ICameraListener listener)
        {
            Camera.RemoveListener(listener);
        }

        public static int Left
        {
            get
            {
                return Camera.Left;
            }
        }

        public static int Top
        {
            get
            {
                return Camera.Top;
            }
        }
    }
}
